package thinkingInJava.enumerated.menu;
// page 579 用接口组织枚举（实现类似继承）
//: enumerated/menu/Food.java
//Subcategorization of enums within interfaces.

import thinkingInJava.enumerated.menu.Food.Appetizer;
import thinkingInJava.enumerated.menu.Food.Coffee;
import thinkingInJava.enumerated.menu.Food.Dessert;
import thinkingInJava.enumerated.menu.Food.MainCourse;

public interface Food {
	enum Appetizer implements Food {
		SALAD, SOUP, SPRING_ROLLS;
	}
	enum MainCourse implements Food {
		LASAGNE, BURRITO, PAD_THAI,
		LENTILS, HUMMOUS, VINDALOO;
	}
	enum Dessert implements Food {
		TIRAMISU, GELATO, BLACK_FOREST_CAKE,
		FRUIT, CREME_CARAMEL;
	}
	enum Coffee implements Food {
		BLACK_COFFEE, DECAF_COFFEE, ESPRESSO,
		LATTE, CAPPUCCINO, TEA, HERB_TEA;
	}
} ///:~

class TypeOfFood {
	public static void main(String[] args) {
		Food food = Appetizer.SOUP;	// 这些枚举相当于继承了 Food
		food = MainCourse.LASAGNE;
		food = Dessert.GELATO;
		food = Coffee.CAPPUCCINO;
	}
} ///:~